package org.bringer.service;

import java.util.Calendar;
import java.util.List;

import javax.jws.WebService;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.bringer.model.Annotation;

/**
 * Web Service interface so hierarchy of Generic Manager isn't carried through.
 */
@WebService
@Path("/annotations")
public interface AnnotationService {
    
    @GET
    @Path("/getAnnotationByDescription/{desc}")
    @Produces(MediaType.APPLICATION_JSON)
    List<Annotation> getAnnotationByDescription(@PathParam("desc") String desc);


    @GET
    @Path("/getAnnotationsByAccount/{ibanCode}")
    List<Annotation> getAnnotationsByAccount(@PathParam("ibanCode") String ibanCode);
    
    @GET
    @Path("/getAnnotationsByAccountInDates/{ibanCode}/{iniDate}/{endDate}")
    List<Annotation> getAnnotationsByAccountInDates(
    		@PathParam("ibanCode") 
    		String ibanCode,
    		@PathParam("iniDate") 
    		Calendar iniDate,
    		@PathParam("endDate") 
    		Calendar endDate);
    
    @GET
    @Path("/getAnnotationsByAccountAboveX/{ibanCode}/{amount}")
    List<Annotation> getAnnotationsByAccountAboveX(
    		@PathParam("ibanCode") 
    		String ibanCode,
    		@PathParam("amount") 
    		Double amount
    		);
    
   
    @POST
    @Path("/saveAnnotation")
    Annotation saveAnnotation(Annotation annotation);

    /**
     * Removes a account from the database by their accountId
     *
     * @param accountId the account's id
     */
    @DELETE
    @Path("/removeAnnotation")
    void removeAnnotation(String annotationId);    
   
}
